//
//  SCBaseViewController.h
//  Assembly
//
//  Created by 葛悦彣 on 2023/11/9.
//

#import <UIKit/UIKit.h>
#import "ACMediaPickerManager.h"

NS_ASSUME_NONNULL_BEGIN

@interface SCBaseViewController : UIViewController

@property (nonatomic ,strong) UITableView * tableview;
@property (nonatomic,assign) BOOL isTableviewZD;

///白色状态栏,所有自控制器都需要设置
@property (nonatomic,assign) BOOL isWhite;

@property (nonatomic, assign) int pageNo;
@property (nonatomic, assign) int pageSize;

///关闭侧滑
@property (nonatomic, assign) BOOL shutDownBack;

///状态栏颜色 黑白切换 默认黑色
@property (nonatomic, assign) BOOL StatusBarColor;
///隐藏无数据
@property (nonatomic, assign) BOOL NoDataHidden;

///默认会调用pop方法
- (void)back;
///pop
- (void)popViewController;


/// 重新加载
-(void)refreshingData;

/// 加载更多
-(void)addMoreData;

///刷新接口
- (void)loadNewData;


///添加上拉控件
- (void)addFooterView:(MJRefreshComponentAction)Block;
- (void)addFooterView:(MJRefreshComponentAction)Block andCount:(int)count;
///添加下拉控件
- (void)addHeaderView:(MJRefreshComponentAction)Block;

- (void)openImgArray:(NSArray *)array andindex:(int)index ;
- (ACMediaPickerManager *)openXJandBlock:(void(^)(NSArray<ACMediaModel *> * list))block;
- (ACMediaPickerManager *)openXJWithType:(ACMediaPickerSource)type  andBlock:(void(^)(NSArray<ACMediaModel *> * list))block;
///获取地址
@property (nonatomic ,strong) NSString * addressStr;
- (void)addressWithBlock:(void(^)(NSString*))block;

@end

typedef NS_ENUM(NSInteger, GradientColorDirection) {
    GradientColorDirectionLevel,//水平渐变
    GradientColorDirectionVertical,//竖直渐变
    GradientColorDirectionDownDiagonalLine,//向上对角线渐变
    GradientColorDirectionUpwardDiagonalLine,//向下对角线渐变
};

@interface UIColor (Gradient)

/// 设置渐变色
/// @param size 需要渐变的大小
/// @param direction 渐变的方向
/// @param startcolor 渐变的开始颜色
/// @param endColor 渐变的结束颜色
+ (instancetype)gradientColorWithSize:(CGSize)size
                            direction:(GradientColorDirection)direction
                           startColor:(UIColor *)startcolor
                             endColor:(UIColor *)endColor;

@end

@interface UIGTapGestureRecognizer : UITapGestureRecognizer
@property (nonatomic ,strong) NSDictionary * userInfo;

@end
NS_ASSUME_NONNULL_END
